{extend name="public:base" /}
{block name="body"}
<div class="row">
    <div class="col-md-8">
        <div class="page-header">
            <h2>发布文章</h2>
        </div>
        <form action="{:url('index/index/save')}" method="post" id="login" enctype="multipart/form-data">
            <div class="form-group">
                <label for="title">标题</label>
                <input type="text" name="title" class="form-control" id="title" placeholder="文章标题">
            </div>
            <div class="form-group">
                <label>分类</label>
                <select class="form-control" name="cate_id"> <!--name与字段名对应-->
                    {volist name="catelist" id="cate"}
                    <option value="{$cate.id}">{$cate.name}</option>
                    {/volist}
                </select>
            </div>
            <div class="form-group" >
                <label>内容</label>
                <textarea  placeholder="文章内容" id="content" name="content"></textarea>
            </div>
            <div class="form-group">
                <label for="title_img">标题图片</label>
                <input type="file" name="title_img" id="title_img">
                <p class="help-block"></p>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary">保存</button>
                </div>
            </div>
        </form>
    </div>
{/block}
{block name="js"}
{load href="/static/ueditor/ueditor.config.js" /}
{load href="/static/ueditor/ueditor.all.min.js" /}
{load href="/static/ueditor/lang/zh-cn/zh-cn.js" /}
<script>
    // UE.getEditor('content', {
    //     initialFrameHeight:500 // 初始化高度
    // })

    $(function() {

        //content为要编辑的textarea的id
        UE.getEditor('content', {
            // serverUrl:"{:url('index/ueditor/index')}",
            // initialFrameWidth: 1100,   //初始化宽度
            initialFrameHeight:200 // 初始化高度
        })
    })
</script>
{/block}
